﻿using System;
using System.Collections.Generic;
using System.Collections.Generic.Sync ;
using System.Linq;
using System.Text;
using WayneGameSolution.Membership;
using System.Runtime.Serialization;

namespace WayneGameSolution.Chat
{
    [DataContract]
    public class ChatMessage : IChatMessage 
    {
        public ChatMessage(string text, IChater fromC, IChater toC, MessageRenderType type, string channelName, bool inPrivate)
        {
            TimeStamp = DateTime.Now;
            ChannelName = ChannelName;
            ChaterFrom = fromC.UID;
            ChaterTo = toC.UID;
            Text = text;
            RenderType = type;
           
        }
        public ChatMessage()
        { }

 

        #region IChatMessage Members
        [DataMember]
        public string ChannelID
        {
            get;
            set;
        }
        [DataMember]
        public string ChannelName
        {
            get;
            set;
        }
        [DataMember]
        public string ChaterFrom
        {
            get;
            set; 
        }
        [DataMember]
        public string ChaterTo
        {
            get;
            set; 
        }
        [DataMember]
        public MessageRenderType RenderType
        {
            get;
            set;
        }
        [DataMember]
        public string Text
        {
            get;
            set;
        }
        [DataMember]
        public DateTime TimeStamp
        {
            get;
            set;
        }

   
        #endregion

        #region ICloneable Members

        public object Clone()
        {
            return MemberwiseClone();
        }

        #endregion



        #region IRecycleNode<IChatMessage> Members

        public IRecycleNode<IChatMessage> Lower
        {
            get;
            set;
        }

        public IRecycleNode<IChatMessage> Higher
        {
            get;
            set;
        }

        public IChatMessage Value
        {
            get
            {
                return this;
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        #endregion
    }
}
